package com.kevin.design.creationalPattern.abstractFactory;

public class AbstractFactoryOfSkin {
    public static void main(String[] args) {
        SkinFactory skinFactory = new SSkinFactory();
        Background background = skinFactory.createBackground();
        Button botton = skinFactory.createBotton();
        Text text = skinFactory.createText();
        background.display();
        text.display();
        botton.display();

    }
}
class SSkinFactory implements SkinFactory{

    @Override
    public Button createBotton() {
        return new Sbutton();
    }

    @Override
    public Text createText() {
        return new Stext();
    }

    @Override
    public Background createBackground() {
        return new Sbackground();
    }
}
class Sbackground implements Background{

    @Override
    public void display() {
        System.out.println("显示简单背景");
    }
}
class Stext implements Text{

    @Override
    public void display() {
        System.out.println("显示简单文本");
    }
}
class Sbutton implements Button{

    @Override
    public void display() {
        System.out.println("显示简单按钮");
    }
}

interface SkinFactory{
    Button createBotton();
    Text createText();
    Background createBackground();
}

interface Button{
    void display();
}

interface Text{
    void display();
}

interface Background{
    void display();
}